package com.example.project.controller;

import com.example.project.entity.Menu;
import com.example.project.entity.ResponseInfo;
import com.example.project.entity.Roles;
import com.example.project.service.MenuService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    MenuService menuService;

    @RequestMapping("/getmenutable")
    public ResponseInfo getmenutable(Menu menu,String token){
        ResponseInfo res=menuService.getmenutable(menu,token);

        return res;
    }
    @RequestMapping("/menutable")
    public ResponseInfo menutable(Menu menu){
        ResponseInfo res=menuService.menutable(menu);
        return res;
    }
    @RequestMapping("/addtable")
    public ResponseInfo addtable(Menu menu){
        ResponseInfo res=menuService.addtable(menu);
        return res;
    }
    @RequestMapping("/edittable")
    public ResponseInfo edittable(Menu menu){
        ResponseInfo res=menuService.edittable(menu);
        return res;
    }
    @RequestMapping("/deltable")
    public ResponseInfo deltable(Menu menu){
        ResponseInfo res=menuService.deltable(menu);
        return res;
    }

    @RequestMapping("/getrolemenutable")
    public ResponseInfo getrolemenutable(Roles roles){
        ResponseInfo res=menuService.getrolemenutable(roles);
        return res;
    }
}
